﻿
namespace SBIP
{
    using System;
    using System.Windows.Forms;

    using SBIP.Filter;

    /// <summary>Filter specified properties form.</summary>
    public partial class MeanShiftForm : Form
    {
        MeanShift filter;

        /// <summary>
        /// Initializes a new instance of the <see cref="MeanShiftForm"/> class.
        /// </summary>
        /// <param name="processor">The processor.</param>
        public MeanShiftForm(Processor processor)
        {
            InitializeComponent();
            this.filter = new MeanShift();
            processor.Filter = this.filter;
        }

        private void MeanShiftSpatialRadiusTrackBar_ValueChanged(object sender, EventArgs e)
        {
            filter.SpatialRadius = MeanShiftSpatialRadiusTrackBar.Value;
            SpatialRadiusValue.Text = filter.SpatialRadius.ToString();
        }

        private void MeanShiftColorDistanceTrackBar_ValueChanged(object sender, EventArgs e)
        {
            filter.ColorDistance = MeanShiftColorDistanceTrackBar.Value;
            ColorDistanceValue.Text = filter.ColorDistance.ToString();
        }

        private void MeanShiftMinimumShiftedTrackBar_ValueChanged(object sender, EventArgs e)
        {
            filter.MinimumShifted = MeanShiftMinimumShiftedTrackBar.Value;
            MinimumShiftedValue.Text = filter.MinimumShifted.ToString();
        }

        private void MeanShiftMaximumIterationTrackBar_ValueChanged(object sender, EventArgs e)
        {
            filter.MaximumIteration = MeanShiftMaximumIterationTrackBar.Value;
            MaximumIterationValue.Text = filter.MaximumIteration.ToString();
        }
    }
}
